package com.qf.sclg.exception;

import com.qf.sclg.result.ResponseCode;

/**
 * 自定义异常的返回
 * 错误的状态码和消息
 * Created with IntelliJ IDEA.
 * User: zdk
 * Date: 2021/10/14 10:18
 * Description:
 * Version: V1.0
 */
public class BusinessException extends RuntimeException {
    private String code;
    private String info;

    public BusinessException(String code, String info) {
        this.code = code;
        this.info = info;
    }
    public BusinessException(ResponseCode responseCode) {
        this.code =responseCode.getCode();
        this.info = responseCode.getMessage();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }
}
